//
//  CommitModel.swift
//  TFSClient
//
//  Created by Samuel Richard Magny on 2015-09-25.
//  Copyright © 2015 Samuel Richard Magny. All rights reserved.
//

import Cocoa
import ObjectiveGit

public class CommitModel {

    public var username: String = ""
    public var email: String = ""

    public var message: String = ""
    public var messageDetails: String = ""
    public var messageSummary: String = ""
    public var commitDate: NSDate?
    public var commitTimeZone: NSTimeZone?
    
    /// Is this a merge commit?
    public var isMerge: Bool = false
    
    internal var reference:GTCommit?;
    
    internal init(reference:GTCommit)
    {
        self.reference = reference
        
        if let signature = reference.author
        {
            self.username = signature.name!
            self.email = signature.email!
        }
        
        self.message = reference.message!
        self.messageDetails = reference.messageDetails
        self.messageSummary = reference.messageSummary
        self.commitDate = reference.commitDate
        self.commitTimeZone = reference.commitTimeZone
    }
    
}
